package com.xingda.packing.dmds.rule.check;

import org.springframework.stereotype.Component;

import com.xingda.packing.dmds.domain.ProductBox;

/**
 * 整箱焊点数
 * @author LEGION
 *
 */
@Component("solderNumDMDSCheck")
public class SolderNumCheck implements PackRuleCheckService {
    @Override
    public boolean inspect(ProductBox productBox) {
    	
    	if (productBox.getType() == 2) {
			return true;
		}
    	
    	if (productBox.getType() == 5) {
    		return true;	
		}
    	//如果没开启
    	if (!productBox.getPackDemand().getBoxSolderNum().isEnable()) {
			return true;
		}
    	
        return productBox.solderJointCount() <= productBox.getPackDemand().getBoxSolderNum().getMax().intValue();
    }

}
